package com.card.demo;

public class SilverCard extends  card {
    public SilverCard(String cardId, String name, String Phone, double money) {
        super(cardId, name, Phone, money);
    }

    public SilverCard() {
    }

    @Override
    public void shopMoney(double money) {

        System.out.println("使用银卡购物");
        double shoppedMoney = money*0.9;
        System.out.println("购物成功，实际支付："+shoppedMoney);
        if (shoppedMoney<=getMoney())
        {
            setMoney(getMoney()-shoppedMoney);
        }else
        {
            System.out.println("余额不足");
        }
    }
}
